/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.escuela.view;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Maq-8
 */
@ManagedBean
@SessionScoped
public class AccessBean {

    private String user = "";
    private String pass = "";

    public AccessBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String procesarAccion() {
        if (user.equals("root") && pass.equals("12345")) {
            FacesContext context = FacesContext.getCurrentInstance();
            context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
            return "MenuPrincipal";
        } else {
            return "Login";
        }
    }
}
//primefaces.org/ui